namespace CSharpPro._0923;

public class Demo
{
    private String name;

    /*public void Testprint1() {
        //给定一个数求各个位数字
        Console.WriteLine("请输入一个三位数；");
        int num = Convert.ToInt32(Console.ReadLine());
        Console.WriteLine(num / 100);
        Console.WriteLine(num % 100 / 10);
        Console.WriteLine(num % 10);
    }*/
    public void Testprint2() {
        //判断闰年

        int num = Convert.ToInt32(Console.ReadLine());
        bool flag = (num % 4 == 0 && num % 100 != 0) || num % 400 == 0;
        Console.WriteLine(flag);
    } 
    public void Testprint3() {
                Console.Write("请输入出行月份（1-12）：");
                int month = int.Parse(Console.ReadLine());
        
                Console.Write("请输入交通方式（航班/动车）：");
                string transport = Console.ReadLine();
        
                decimal price = 8800m;
                decimal discount = 1m;
        
                // 判断季节和交通方式
                if (month >= 5 && month <= 10) // 旺季
                {
                    discount = transport == "航班" ? 0.9m : 0.75m;
                }
                else // 淡季
                {
                    discount = transport == "航班" ? 0.6m : 0.3m;
                }
        
                decimal finalPrice = price * discount;
                Console.WriteLine($"最终价格：{finalPrice:F2} 元");
            }
        }